package com.mkksoft.provider.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mkksoft.provider.dao.ServerAccountMapper;
import com.mkksoft.service.HelloService;
import com.mkksoft.vo.ServerAccount;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//dubbo注解，暴露服务
@Service
@Component
public class HelloServiceImpl implements HelloService {

    @Autowired
    private ServerAccountMapper serverAccountMapper;

    @Override
    public String sayHello(String name) {
        return "Hello" + name;
    }

    @Override
    public ServerAccount getServerAccountById(Integer id) {
        QueryWrapper<ServerAccount> wrapper = new QueryWrapper<ServerAccount>();
        wrapper.eq("TARGET_ID",id);
        ServerAccount s =  serverAccountMapper.selectOne(wrapper);
        return s;
    }
}
